﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using LuceneNetSearch;
using Models;
using Webdiyer.WebControls.Mvc;
namespace MVCCompany.Controllers
{
    public class SearchController : Controller
    {
        //
        // GET: /Search/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Search(string keyWords)
        {
            LuceneNetSearch.LuceneSearch luceneSearch = new LuceneSearch();
            IList<BlogInfo> blogList = luceneSearch.BlogSearch(keyWords);
            ViewBag.BlogList = blogList.ToPagedList<BlogInfo>(1,20);
            return View();
        }

    }
}
